home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / What's New? / Development Kits / Speech Recognition Mgr 1.5 / SR Sample Code / IM SR Example / MyInstallSpeechAEHandlers.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  743 b   |  24 lines  |  [TEXT/CWIE]

  1. #include <SpeechRecognition.h>
  2. #include <AppleEvents.h>
  3.  
  4. OSErr    MyInstallSpeechAEHandlers (void);
  5.  
  6.  
  7. extern pascal OSErr MyHandleSpeechDetected (const AppleEvent *theAppleEvent, 
  8.                                     const AppleEvent * reply, long handlerRefcon);
  9. extern pascal OSErr MyHandleSpeechDone (const AppleEvent *theAppleEvent, 
  10.                                     const AppleEvent * reply, long handlerRefcon);
  11.  
  12. OSErr    MyInstallSpeechAEHandlers (void)
  13. {
  14.     OSErr                myErr = noErr;
  15.     SRWord                myRejectedWord = 0;
  16.     
  17.     myErr = AEInstallEventHandler(kAESpeechSuite, kAESpeechDetected,
  18.                 NewAEEventHandlerProc(MyHandleSpeechDetected), 0, false);
  19.     
  20.     if (!myErr) myErr = AEInstallEventHandler(kAESpeechSuite, kAESpeechDone,
  21.                 NewAEEventHandlerProc(MyHandleSpeechDone), 0, false);
  22.     
  23.     return myErr;
  24. }